﻿using System;
using SharpSqlAnalyzer.nodes;
using SharpSqlAnalyzer.pp.processor.type.comm;
using SharpSqlAnalyzer.pp.utils;
using SharpSqlAnalyzer.stmt;

namespace SharpSqlAnalyzer.pp.processor.type.plsql
{
	// Token: 0x02000234 RID: 564
	public class CreateFuncFirstParamInNewlineProcessor : AbstractProcessor
	{
		// Token: 0x060012D4 RID: 4820 RVA: 0x0031AE54 File Offset: 0x00319054
		public override void process(TParseTreeNode nodeArg)
		{
			TStoredProcedureSqlStatement tstoredProcedureSqlStatement = nodeArg as TStoredProcedureSqlStatement;
			bool? flag = new bool?(this.getParameter<bool>(typeof(bool)));
			if (!flag.Value)
			{
				return;
			}
			if (tstoredProcedureSqlStatement.ParameterDeclarations == null || tstoredProcedureSqlStatement.ParameterDeclarations.size() == 0)
			{
				return;
			}
			TSourceToken startToken = tstoredProcedureSqlStatement.ParameterDeclarations.getParameterDeclarationItem(0).startToken;
			if (startToken == null)
			{
				return;
			}
			int length = SourceTokenOperator.curIndentLenVT(startToken) + this.Option.indentLen;
			SourceTokenOperator.addBefore(this.Option, startToken, SourceTokenOperator.createReturnSourceToken());
			SourceTokenOperator.addBefore(this.Option, startToken, SourceTokenOperator.createWhitespaceSourceToken(length));
		}
	}
}
